package com.bzsys.ajax;

import java.util.ArrayList;

import org.apache.ibatis.session.SqlSession;
import org.omg.CORBA.PRIVATE_MEMBER;

import com.bzsys.bean.UserBean;
import com.bzsys.mapper.UserMapper;
import com.bzsys.util.ConnUtil;
import com.opensymphony.xwork2.ActionSupport;

public class UserAction  extends ActionSupport {
	
	private  String returnFlag="";
	
	public  String getReturnFlag() {
		return returnFlag;
	}

	public  void setReturnFlag(String returnFlag) {
		this.returnFlag = returnFlag;
	}
	
	private String id;
	private String email;
	

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String postEmail() {		
		SqlSession sqlSession = ConnUtil.getSqlSession();
		UserBean userBean = new UserBean();
		userBean.setId(id);
		userBean.setEmail(email);
        try {        	
			UserMapper userMapper = sqlSession.getMapper(UserMapper.class); 			
			userMapper.doUpdate(userBean); 	
        } catch (Exception e) {        	
            e.printStackTrace();            
        } finally {        	
            sqlSession.close();            
        }
		returnFlag = "success";
		
		return SUCCESS;
	}
}
